<?php
session_start();
$loginId=$_SESSION['loginid'];
$name=$_SESSION['name'];
$userType=$_SESSION['user_type'];

include("connection/connection.php");
 include('config.php');
$frm=$_REQUEST['var'];
$qr="select * from tbl_dtls_q1_main where id='$frm'";
$res=mysql_query($qr);
$row=mysql_fetch_array($res);
?>
 <html>
 <head></head>
 <body>
  <div  class="section_format">	
 <form action="scheme_section1.php" method="post" name="sec1" id="sec1" onSubmit="return sec1_val();">
  <div style="height:30px" align="center"><?php echo $reference_id;?></div>
  <table border="1">
    
    <tr>
      <td width="400">&nbsp;<b>Type of the Scheme (As of Now)</b>
	  <input type="hidden" name="frmId" id="frmId" value="<?php echo $frm;?>" />
	  <input type="hidden" name="loginId" id="loginId" value="<?php echo $loginId;?>" />
	  <input type="hidden" name="name" id="name" value="<?php echo $name;?>" />
	  <input type="hidden" name="userType" id="userType" value="<?php echo $userType;?>" />
	  <input type="hidden" name="typeScheme" id="typeScheme" value="<?php echo $_SESSION[type_scheme];?>" />
	  </td>
      <td width="400">&nbsp;<input type="radio" name="type_scheme" id="type_scheme" value="P&T" <?php echo ($row['type_scheme']=='P&T'?'checked':'');?> /> P&T <input type="radio" name="type_scheme" id="type_scheme" value="TSS(P&T)" <?php echo ($row['type_scheme']=='TSS(P&T)'?'checked':'');?> />TSS(P&T) <input type="radio" name="type_scheme" id="type_scheme" value="Piped" <?php echo ($row['type_scheme']=='Piped'?'checked':'');?> />Piped<input type="radio" name="type_scheme" id="type_scheme" value="Sanitary Diggs" <?php echo ($row['type_scheme']=='Sanitary Diggs'?'checked':'');?> />Sanitary Diggi
	  </td>
      </tr>
    <tr>
      <td>&nbsp;<b>Name of the Scheme</b></td>
      <td>&nbsp;<input type="text" name="scheme_name" id="scheme_name" value="<?php echo "$row[name_scheme]";?>" /> <input type="hidden" name="sch_id" id="sch_id" value="<?php echo $frm;?>" /></td>
      </tr>
    <tr>
      <td>&nbsp;<b>Year of Commissioning</b></td>
      <td>&nbsp;<!--<input type="text" name="YOC" id="YOC" value="<?php echo "$row[year_comm]";?>" />-->
	  <select size="1" name="YOC" id="YOC" class="txt">
                        <option selected value="">Select Year</option>
						<option selected value="0">Not Provided</option>
                        <?php
                        foreach($year_comm as $key=>$val)
                        {
                            if($row['year_comm']==$val)
                            {
                                   echo "<option value=$val selected>$val</option>";
                            }
                            else
                            {
                                echo "<option value=$val>$val</option>";
                            }
                        }
                        ?>
                        </select>
	  </td>
      </tr>
    <tr>
      <td>&nbsp;<b>Capital Cost (in <img src="images/26rup1.jpg" width="10"> Lakh)</b></td>
      <td>&nbsp;<input type="text" name="CC" id="CC" value="<?php echo "$row[capital_cost]";?>" /></td>
      </tr>
	  <tr>
      <td>&nbsp;<b>Scheme Sanctioned Under</b></td>
      <td>&nbsp;<select size="1" name="scheme_sactioned" id="scheme_sactioned" class="txt" onChange="enable_sanc1(true)">
                      <option selected value="0">Select Scheme</option>
                      <?php 
						foreach($scheme as $key=>$val)
						{
							$val1=$row['scheme_sactioned'];
						if($val1=='State-Plan-(Old-MNP)' || $val1=='NRDWP-(Old-ARDWP)' || $val1=='Swajal-Dhara-&-Sector-Reform')
						{
							if($val1==$val)
							{
		   						echo "<option value=$val selected>$val</option>";
							}
							else
							{
								echo "<option value=$val>$val</option>";
							}
						}
						if($val1!='State-Plan-(Old-MNP)' && $val1!='NRDWP-(Old-ARDWP)' && $val1!='Swajal-Dhara-&-Sector-Reform')
						{
							if($val1!=$val)
							{
		   						echo "<option value=$val selected>$val</option>";
							}
							else
							{
								echo "<option value=$val>$val</option>";
							}
						}
						}
						?>
                    </select></td>
      </tr>
	  <tr>
				  <td width="270" height="26">&nbsp;</td>
					<td width="477">&nbsp;
						 <font style="font-size: 8pt" face="Verdana" color="#000000"> If Other then specify&nbsp;</font><input type="text" name="scheme_sactioned_other" id="scheme_sactioned_other" value="<?php if($row['scheme_sactioned']!='State-Plan-(Old-MNP)' && $row['scheme_sactioned']!='NRDWP-(Old-ARDWP)' && $row['scheme_sactioned']!='Swajal-Dhara-&-Sector-Reform'){ echo $row['scheme_sactioned'];$dis=""; } else{ echo '';$dis="disabled";} ?>" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px" <?php echo $dis;?>></td>
				</tr>
	  <tr>
	    <td colspan="2" align="center"><input type="submit" value="EDIT" name="submit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px; font-weight:bold; background:#666666; color:#FFFFFF; width:140px; height:30px" onClick="view_validate()"></td>
  </tr>
  </table>
  </form>
 </div>
 </body></html>